$(function () {
    let id=localStorage.getItem("groupId");
    findById(id)
})
function findById(id) {
    let data=myAjax("/group/findById",{id:id},"post");
    data=data.groupBean;
    $("#code").val(data.code);
    $("#groupName").val(data.groupName);
    $("#teamLeaderName").val(data.teamLeaderName);
    $("#teamLeaderCode").val(data.teamLeaderCode);
}

function groupUpdate() {
    let da={
        id:localStorage.getItem("groupId"),
        code:$("#code").val(),
        groupName:$("#groupName").val(),
        teamLeaderName:$("#teamLeaderName").val(),
        teamLeaderCode:$("#teamLeaderCode").val()
    }
    let data=myAjax("/group/groupUpdate",da,"post");
    data=data.result;
    if (data==1){
        alert("修改成功！");
        $('#middle-reght').load('group/group.html');
    }else if (data==2){
        alert("修改失败,没有这个人，请先添加！");
    }else{
        alert("修改失败！");
    }
}